<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/member/member/save}">
        <input type="hidden" name="id" th:if="${member}" th:value="${member.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" placeholder="请输入姓名" th:value="${member?.name}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择性别</label>
            <div class="layui-input-inline">
                <input type="radio" name="sex" value="2" title="女" checked><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>男</div></div>
                <input type="radio" name="sex" value="1" title="男" th:checked="${member?.sex} eq 1"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>女</div></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="phone" placeholder="请输入电话" th:value="${member?.phone}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline">
            	<input type="text" name="birthday" th:value="${#dates.format(member?.birthday, 'yyyy-MM-dd')}" class="layui-input" id="laydate" placeholder="yyyy-MM-dd" lay-key="1">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">会员级别</label>
            <div class="layui-input-inline">
                <select name="level" mo:dict="MEMBER_LEVEL" mo-selected="${member?.level}" mo-empty="" lay-verify="level"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">账户余额</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="account" placeholder="请输入账户余额" th:value="${member?.account}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${member?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
<script>
layui.use(['element', 'laydate', 'form'], function () {
    var $ = layui.jquery;
    var form = layui.form;
    var laydate = layui.laydate;


    //初始化laydate实例
    laydate.render({
        elem: '#laydate'
    });
});
</script>
</body>
</html>